import { defineStore } from 'pinia'

export const useEvaluationStore = defineStore('evaluation', {
  state: () => ({
    selectedQuestionIds: [] as number[],
    showEvaluationCreator: false,
    evaluationConfig: {
      title: '',
      description: '',
      prompt: '',
      judges: [] as string[],
      models: [] as string[]
    }
  }),
  actions: {
    setSelectedQuestions(ids: number[]) {
      this.selectedQuestionIds = ids
    },
    toggleEvaluationCreator(show: boolean) {
      this.showEvaluationCreator = show
    },
    setEvaluationConfig(config: {
      title: string
      description: string
      prompt: string
      judges: string[]
      models: string[]
    }) {
      this.evaluationConfig = config
    },
    reset() {
      this.selectedQuestionIds = []
      this.evaluationConfig = {
        title: '',
        description: '',
        prompt: '',
        judges: <string[]>[],
        models: <string[]>[]
      }
    }
  }
})